﻿layui.config({
    base: "Scripts/"
}).use(['form', 'layer', 'layedit', 'laydate'], function () {
    var form = layui.form
			  , layer = layui.layer
			  , layedit = layui.layedit
			  , laydate = layui.laydate
              ,$ = layui.jquery;

    var loginManager = {
        loginSubmit: function (data) {
            $.ajax({
                type: "POST",
                url: "/TransferEmp/TransferAdd",//发送请求  
                data: data.field,
                dataType: "json",
                success: function (result) {
                    if (result.State == 1)
                        layer.alert(result.Message, { icon: 7 });
                    else
                        layer.msg(result.Message, { icon: 1 }, function (index) {
                            //location.href = '/Page/Index';
                            layer.close(index);
                        });
                }
            });
        }
    };

    $("#validateCode").click(function () {
        loginManager.loginSubmitloginSubmit();
    });

    //监听提交
    form.on('submit(TransferAdd)', function (data) {
        loginManager.loginSubmit(data);
        return false;
    });

});
